
import {simpleServer} from '@/tools/servers'

/**
 * 地址
 */
export class AddressService {
    // 分页查询列表
    static findAddresss (pageDTO) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.findAddresss,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/address/Address/findAddresss', body);
    }


    //根据地址Id查询地址
    static findAddress (addressId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAddress ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/address/Address/findAddress',body);
    }

    //为了编辑,根据地址Id查询地址
    static findAddressForEdit(addressId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAddressForEdit ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/address/Address/findAddressForEdit',body);
    }

    //为了查看,根据地址Id查询地址，所有外键字段的名称都已加载
    static findAddressForView(addressId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAddressForView ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/address/Address/findAddressForView',body);
    }

    //创建新的地址
    static createAddress() {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.createAddress,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/address/Address/createAddress',body);
    }

    //保存地址
    static saveAddress(address) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.saveAddress,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/address/Address/saveAddress', body);
    }

    //编辑地址
    static updateAddress (address) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.updateAddress,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/address/Address/updateAddress', body);
    }

    //根据地址Id删除地址
    static deleteAddress (addressId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.deleteAddress,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/address/Address/deleteAddress',body);
    }

    //为了查看,根据地址Id查询地址，只加载ID 和 名称
    static findAddresssWithIdNameById(addressId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAddresssWithIdNameById ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/address/Address/findAddresssWithIdNameById',body);
    }

    //为了查看,根据地址 名称 查询地址，只加载ID 和 名称
    static findAddresssWithIdNameByName(addressName) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAddresssWithIdNameByName ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/address/Address/findAddresssWithIdNameByName',body);
    }


}
